import java.util.Scanner;

public class CompanyText {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Company c = new Company();
        while (true) {
            System.out.println("请选择");
            System.out.println("1：招聘员工，2：输出员工信息，3：辞退员工，4：统计公司人数," +
                    "\n5：显示公司信息并退出，6：查找薪水最高的员工，7：薪水从高到低排序，8：所有员工的平均工资，9：涨工资");
            int a = in.nextInt();
            if (a == 1) {
                System.out.println("请输入姓名");
                String name = in.next();
                System.out.println("请输入年龄");
                int age = in.nextInt();
                System.out.println("请输入性别");
                String gende = in.next();
                System.out.println("请输入职务");
                String duty = in.next();
                System.out.println("请输入薪水");
                double money = in.nextDouble();
                c.recruit(name, age, gende, duty, money);
            } else if (a == 2) {
                c.message();
            } else if (a == 3) {
                System.out.println("请输入辞退员工姓名");
                String name = in.next();
                c.refuse(name);
            } else if (a == 4) {
                System.out.println(c.people());
            } else if (a == 5) {
                c.show();
                return;
            }else if (a == 6) {
                c.findTopSalary();
            }else if (a == 7) {
                c.sortBySalDesc();
            }else if (a == 8) {
                System.out.println("平均工资："+c.average());
            }else if (a == 9) {
                c.addmoney();
            }
        }

    }
}
